package example.config;


import org.springframework.stereotype.Component;
import org.springframework.web.servlet.HandlerInterceptor;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

@Component
public class Mylnterceptor implements HandlerInterceptor {
    @Override
    public boolean preHandle(HttpServletRequest request, HttpServletResponse response,Object handler) throws Exception{
      //  String uri = request.getRequestURI();
      //  Object loginName = request.getSession().getAttribute("uname");
      //  System.out.println("loginName ====" + loginName);
        //if (uri.startsWith("/admin") && null == loginName){
            //response.sendRedirect("/toLoginPage");
           // return false;
    //    }
        return true;
    }
}
